CC = g++

TARGET = data_bridge

# 使用C++17 -g
# 宏 _REENTRANT （需要可重入功能）
# 宏 BOOST_ALL_DYN_LINK（Boost库以动态库链接）
CFLAGS += -pipe -std=gnu++17 -Wall -w -D_REENTRANT -DBOOST_ALL_DYN_LINK -DBOOST_LOG_DYN_LINK -DBOOST_BIND_GLOBAL_PLACEHOLDERS
CFLAGS += -DBOOST_BIND_GLOBAL_PLACEHOLDERS

Version = 1.0.0

SRC += main.cpp \
	   log4cpp.cpp 


OBJS  += main.o \
		 log4cpp.o 


R0S2FW = ./
# include $(R0S2FW)Ros2.mak
# include $(R0S2FW)Ros2_eloquent.mak

BOOSTSDK = ./
include $(BOOSTSDK)Boost.mak
# include $(BOOSTSDK)Boost_1804.mak

LDFLAGS += -Wl,-rpath=../liblog4cplus/lib

$(info APPLIBS: $(APPLIBS))

INCLUDE_PATH += -I./ -I./include -I./3rdParty $(ROS2_LIBS_INCLUDE) $(BOOSTSDK_INCLUDE) -I$(APPLIBS)/jsoncpp/include \
			    -I$(APPLIBS)/pugixml/include -I$(APPLIBS)/zeromq/include -I../out/include \
				
				
LIBS += -L./ -L./lib -lpthread  $(ROS2_LIBS_NAME) $(BOOSTSDK_LIBS_NAME) 
LIBS += -L$(APPLIBS)/jsoncpp/lib -L$(APPLIBS)/pugixml/lib  -L$(APPLIBS)/zeromq/lib  -L../out/lib \
        -L$(APPLIBS)/muduo/lib
LIBS += -llog4cplus 

OBJECTS_DIR = ./

all:$(TARGET)
$(OBJS) : $(SRC)
	$(CC) $(CFLAGS) $(INCLUDE_PATH) -c $(SRC)
$(TARGET): $(OBJS)
	rm -f $@
	$(CC) $(CFLAGS) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIBS)

	# rm -f $(OBJS)

.PHONY:clean
clean:
	rm -f $(OBJS)
	rm -f $(OBJECTS_DIR)$(TARGET)
